LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-10-2014, 07:39 PM   #1
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
Python/Gtk3: dialog.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK)


The code
Code:
dialog.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK)
works just fine, and does exactly what I want, but it's apparently depricated, as shown by these warnings:
Quote:
partition_generator_0.4.py:94: Warning: The property GtkButton:use-stock is deprecated and shouldn't be used anymore. It will be removed in a future version.
dialog.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK)
partition_generator_0.4.py:94: Warning: The property GtkSettings:gtk-button-images is deprecated and shouldn't be used anymore. It will be removed in a future version.
dialog.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK
So what's the accepted replacement to achieve the same functionality?
 
Old 08-12-2014, 01:22 AM   #2
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
you can find here some notes
https://docs.google.com/document/d/1...PqKAppCY8o/pub

the samples are c,
bug things like
Code:
Old:

button = gtk_button_new_from_stock (GTK_STOCK_SAVE);

New:

button = gtk_button_new_with_mnemonic (_(“_Save”));
should be not to hard to translate into python


and I agree that the gtk documentation, which is often limited to
Quote:
.... deprecated since version x.xx and should not be used in newly-written code.
is poor, there should be a link to a migration guid and to the new ways of doing it
 
Old 08-12-2014, 07:37 AM   #3
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Original Poster
Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
I had basically done what you suggested
Code:
dialog.add_button("_OK", Gtk.ResponseType.OK)
which gives me the button on the left with text but no image.
Attached Thumbnails
Click image for larger version

Name:	2buttons.png
Views:	22
Size:	3.0 KB
ID:	16114  
 
  


Reply

Tags
gtk3, python


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Making GTK3 themes – Part 2: The gtk.css and gtk-widgets.css file LXer Syndicated Linux News 0 07-24-2012 01:50 PM
Gtk custom dialog nime Programming 0 01-28-2012 06:23 AM
LXer: Build Spice-Gtk-0.6 (GTK2 & GTK3) on Ubuntu 11.10 (Oneiric) LXer Syndicated Linux News 0 06-28-2011 11:51 AM
'dialog' app for GTK+2.0 General Programming 6 04-23-2006 01:10 PM
Dialog modal+GTK santhosh.linux Programming 1 02-20-2006 11:47 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration