Open a popup with spinbox inside from python

More
10 Feb 2022 02:59 - 10 Feb 2022 03:01 #234452 by alkabal
Hello

did you know a whay for add some spinbox in a popup open from a gladevcp panel  button like probe_screen ?

the actual popup system is created by the python code 
github.com/alkabal/PSNG_V3/blob/70d267b6.../python/base.py#L291

At the end the question is more : how to add spinbox in a gtk popup ?

best regards 
Last edit: 10 Feb 2022 03:01 by alkabal.

Please Log in or Create an account to join the conversation.

More
20 Feb 2022 19:50 - 20 Feb 2022 19:52 #235421 by Grotius
Hi,

Just look how to create a spinbox from gtk source examples.

Reference:
lazka.github.io/pgi-docs/Gtk-3.0/classes...tml#Gtk.SpinButton//

Provides a function to retrieve an integer value from a GtkSpinButton
// and creates a spin button to model percentage values.

gint
grab_int_value (GtkSpinButton *button,
gpointer user_data)
{
return gtk_spin_button_get_value_as_int (button);
}

void
create_integer_spin_button (void)
{

GtkWidget *window, *button;
GtkAdjustment *adjustment;

adjustment = gtk_adjustment_new (50.0, 0.0, 100.0, 1.0, 5.0, 0.0);

window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_container_set_border_width (GTK_CONTAINER (window), 5);

// creates the spinbutton, with no decimal places
button = gtk_spin_button_new (adjustment, 1.0, 0);
gtk_container_add (GTK_CONTAINER (window), button);


gtk_widget_show_all (window);
}
Last edit: 20 Feb 2022 19:52 by Grotius.
The following user(s) said Thank You: alkabal

Please Log in or Create an account to join the conversation.

More
20 Feb 2022 22:56 #235436 by alkabal
Thank you ! (i have already found a way, but your intervention is really appreciated !)

Please Log in or Create an account to join the conversation.

Moderators: mhaberler
Time to create page: 0.069 seconds
Powered by Kunena Forum